package com.zzzzzz.topic.service;

import java.io.IOException;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.zzzzzz.core.exception.NoSuchTopicException;
import com.zzzzzz.core.exception.ZzzzzzException;
import com.zzzzzz.topic.model.AddTopicVo;
import com.zzzzzz.topic.model.SimpleTopicBo;
import com.zzzzzz.topic.model.Topic;

public interface TopicService {

	@Transactional
	Topic add(AddTopicVo addTopicVo) throws ZzzzzzException, IOException;

	Topic findById(String topicId) throws NoSuchTopicException;
	
	List<Topic> findAll(int start, int offset, boolean ascending);
	
	List<Topic> findAll(String category, int start, int offset, boolean ascending);

	List<SimpleTopicBo> findAllSimpleBos(String category, int start, int offset, boolean ascending);

	List<SimpleTopicBo> findAllSimpleBos(int start, int offset, boolean ascending);
	
	long findAllCount();
	
	long findCountByCategory(String category);
	
	long findCountByUserId(String userId);

	void edit(Topic topic);
	
	void editStatus(String topicId, Integer status);

}
